﻿using System;

public sealed class Program {
	public static void Main() {
		// Displays "15"
		Console.WriteLine(Add(new Int32[] { 1, 2, 3, 4, 5 }));

		// Displays "15"
		Console.WriteLine(Add(1, 2, 3, 4, 5 ));

		// Displays "0"
		Console.WriteLine(Add());

		DisplayTypes(new Object(), new Random(), "Jeff", 5);
	}

	private static Int32 Add(params Int32[] values) {
		// NOTE: it is possible to pass the 'values' 
		// array to other methods if you want to.

		Int32 sum = 0;
		for (Int32 x = 0; x < values.Length; x++)
			sum += values[x];
		return sum;
	}


	private static void DisplayTypes(params Object[] objects) {
		foreach (Object o in objects)
			Console.WriteLine(o.GetType());
	}
}
